<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .d1{
            width: 1000px;
            height: 1000px;
            background-color:red;
            background-image: url('/Demo/img/1.jpg');
            background-repeat: no-repeat;
            /* no-repeat 不重复  repeat-x横向平铺 repeat纵向平铺-y */
            background-position: 10px 20px;
            /* 背景右移10个像素 下移20个像素 */
            /* background:red url('/Demo/img/1.jpg') no-repeat 10px 20px;  用一行来写*/
            background-size: contain; 
            /* contatin  x，y其中一个铺满 */
            /* cover  x，y都铺满 */


        }
    </style>
</head>
<body>
    <div class="d1"></div>
</body>
</html>